﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using EHTWebsiteProject.Code.Entity;
using EHTWebsiteProject.Code.BLL;

namespace EHTWebsiteProject
{
    public partial class CustomerAccountBalance : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                // lay thong tin current balance
                MembershipUser theUser = Membership.GetUser(HttpContext.Current.User.Identity.Name);
                string CustomerID = theUser.ProviderUserKey.ToString();
                CurrentBalance theCurrentBalance = AccountBalanceProvider.GetCurrentBalanceByCustomerID(CustomerID);
                this.lbCurrentBalanceValue.Text = theCurrentBalance.TotalAmount.ToString();
            }
            catch
            {
                this.lbCurrentBalanceValue.Text = "0";
            }
        }
    }
}